﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Admin.aspx.cs" Inherits="Admin" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
            BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4" 
            DataKeyNames="UserID" DataSourceID="SqlDataSource1" 
            EnableModelValidation="True">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                    ShowSelectButton="True" />
                <asp:BoundField DataField="UserID" HeaderText="UserID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="UserID" />
                <asp:BoundField DataField="Card Holder's" HeaderText="Card Holder's" 
                    SortExpression="Card Holder's" />
                <asp:BoundField DataField="Expiry Date" HeaderText="Expiry Date" 
                    SortExpression="Expiry Date" />
                <asp:BoundField DataField="Card Number" HeaderText="Card Number" 
                    SortExpression="Card Number" />
                <asp:BoundField DataField="CVC Code" HeaderText="CVC Code" 
                    SortExpression="CVC Code" />
            </Columns>
            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
            <RowStyle BackColor="White" ForeColor="#330099" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
        </asp:GridView>
        <br />
        <br />
        <br />
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:RegConnectionString %>" 
            DeleteCommand="DELETE FROM [Registration] WHERE [UserID] = @UserID" 
            InsertCommand="INSERT INTO [Registration] ([Card Holder's], [Expiry Date], [Card Number], [CVC Code]) VALUES (@column1, @Expiry_Date, @Card_Number, @CVC_Code)" 
            SelectCommand="SELECT * FROM [Registration]" 
            UpdateCommand="UPDATE [Registration] SET [Card Holder's] = @column1, [Expiry Date] = @Expiry_Date, [Card Number] = @Card_Number, [CVC Code] = @CVC_Code WHERE [UserID] = @UserID">
            <DeleteParameters>
                <asp:Parameter Name="UserID" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="column1" Type="String" />
                <asp:Parameter Name="Expiry_Date" Type="String" />
                <asp:Parameter Name="Card_Number" Type="String" />
                <asp:Parameter Name="CVC_Code" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="column1" Type="String" />
                <asp:Parameter Name="Expiry_Date" Type="String" />
                <asp:Parameter Name="Card_Number" Type="String" />
                <asp:Parameter Name="CVC_Code" Type="String" />
                <asp:Parameter Name="UserID" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
    
    </div>
    </form>
</body>
</html>
